package com.study.IoC;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Created by 汪贵春 on 2017/2/22.
 */
@Component("header")
public class StraightHeader implements Header {
    @Value("${color}")
    public String color;

    public void setColor(String color) {
        this.color = color;
    }

    public void setSize(int size) {
        this.size = size;
    }
    @Value("${size}")
    public int size;

    public void doWork() {
        System.out.println("doWork with " + getInfo());
    }

    public String getInfo() {
        return "StraightHeader whose color = " + color + ",size = "+size+".";
    }
}
